package com.ay7.utils;

import com.ay7.VO.ResultVO;

/**
 * HTTP对象工具类
 * Created by wenjul
 * on 18/3/25 0025 22:24
 */
public class ResultVOUtil {

    /*访问成功 数据不为空*/
    public static ResultVO success(Object object){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }

    /*访问成功 数据为空*/
    public static ResultVO success(){
        return success(null);
    }

    /*访问失败*/
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;

    }
}
